package com.yzt.minemodule.wallet;

import android.content.Intent;
import android.view.View;

import com.yzt.minemodule.R;
import com.yzt.minemodule.activity.H5Activity;
import com.yzt.zhuju.mvp.MVPActivity;
import com.yzt.zhuju.network.AresSubscriber;
import com.yzt.zhuju.network.biz.BizLayer;
import com.yzt.zhuju.network.entity.mine.wallet.WalletConfigBean;
import com.yzt.zhuju.widget.tuiview.TUIEditText;

/**
 * 作者：bobwang
 * 创建时间：2024-01-12 23:57:55
 * 描述：个人实名认证
 */
public class UserAuthActivity extends MVPActivity {

    @Override
    public int getLayoutId() {
        return R.layout.activity_user_auth;
    }

    @Override
    public void installViews() {

        findViewById(R.id.img_back).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });

        findViewById(R.id.tv_next).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                TUIEditText etName = findViewById(R.id.et_name);
                String name = etName.getText().toString();
                TUIEditText etNumber = findViewById(R.id.et_number);
                String number = etNumber.getText().toString();
                BizLayer.getInstance().getMineModule().userAuth(name, number, new AresSubscriber<WalletConfigBean>() {
                    @Override
                    protected void onSuccess(WalletConfigBean wallet) {
                       // RouterMain.goToWeb(wallet.getUrl());
                        Intent intent = new Intent(UserAuthActivity.this, H5Activity.class);
                        intent.putExtra("url", wallet.getUrl());
                        intent.putExtra("view_file", false);
                        startActivity(intent);
                        finish();
                    }
                });
            }
        });
    }
}
